function xxk (){
let dls = document.querySelectorAll(".dl")
let logins = document.querySelectorAll(".nr .login")
//批量注册点击事件
dls.forEach(function(dl,i){
    dl.addEventListener("click",function(){
        dls.forEach(function(a){
            a.classList.remove("active")
        })
        dl.classList.add("active")
        logins.forEach(function(b){
            b.classList.remove("on")
        })
        logins[i].classList.add("on")
    })
})
}
xxk()
// 登录验证
let btn = document.querySelector(".btn3")
let user = document.querySelector(".user")
let pwd = document.querySelector(".pwd")

btn.addEventListener("click",function(){
    if(!(user.value=="szl")){
        return alert("用户名或密码错误")
    }if(!(pwd.value==="123456")){
        return alert("用户名或密码错误")
    }
    alert("登录成功")
    setTimeout(function(){
        location.href = `./index.html?uname=szl`
    },1000)
})